************************************************
***Title: robustness_oak_masting.do
***Creators: Joelle Abramowitz, Shooshan Danagoulian, and Owen Fleming*
***Notes: This file produces the estimates of the effect of pollen exposure on suicide with a control for and interaction of oak masting. 

*For questions, contact
*Owen Fleming
*hg3490@wayne.edu
************************************************


**********SETUP
use data/for_analysis, clear


**********PRODUCE ESTIMATES
*Treatment: location-season quartiles
eststo main_s3_oak: ppmlhdfe count pollen_q2_ls pollen_q3_ls pollen_q4_ls oak_masting $weather, absorb(county year_month month_day) cluster(county) tolerance(1e-06)
estadd ysumm
estadd scalar counties = e(N_clust)
estadd local Controls "Weather, oak masting indicator" 
estadd local FE "County, Year x Month, Month x Day"

*Treatment: location-season quartiles
eststo main_s3_oak_int: ppmlhdfe count pollen_q2_ls pollen_q3_ls pollen_q4_ls c.pollen_q4_ls#c.oak_masting oak_masting $weather, absorb(county year_month month_day) cluster(county) tolerance(1e-06)
estadd ysumm
estadd scalar counties = e(N_clust)
estadd local Controls "Weather, oak masting indicator" 
estadd local FE "County, Year x Month, Month x Day"


**********EXPORT
estout using results/robustness_oak_masting.xls, cells(b(star label(Coef.) fmt(4)) se(par(`"="("'`")""') label(Std. Err.) fmt(4))) stats(ymean N counties Controls FE) starlevels(* 0.1 ** 0.05 *** 0.01) keep(pollen_q2_ls pollen_q3_ls pollen_q4_ls pollen_q4_ls c.pollen_q4_ls#c.oak_masting oak_masting) order(pollen_q2_ls pollen_q3_ls pollen_q4_ls c.pollen_q4_ls#c.oak_masting oak_masting) legend label replace 
eststo clear





